<extend name="Base:main" />
<block name="script">
	<link rel="stylesheet" href="__PUBLIC__/seller/js/uploadify/uploadify.css" />
	<script src="__PUBLIC__/seller/js/uploadify/jquery.uploadify.min.js"></script>
	<link href="__PUBLIC__/seller/js/editor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="__PUBLIC__/seller/js/editor/third-party/template.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/seller/js/editor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/seller/js/editor/umeditor.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/seller/js/editor/lang/zh-cn/zh-cn.js"></script>
    <script src="__PUBLIC__/seller/js/calendar/WdatePicker.js"></script>
</block>
<block name="content">
    <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                商品管理
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">商品管理</a></li>
                <li class="am-active">资料修改</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                      <div class="caption font-green bold">
                        <span class="am-icon-code"></span>资料修改
                    </div>
                </div>
                <div class="tpl-block ">

                    <div class="am-g tpl-amazeui-form">

                                        <form class="am-form am-form-horizontal" ignoreHidden name='myfromSubmit'>
                                            <input type="hidden" name="poster[id]" value="{$info['id']}">
                                                    <div class="am-form-group">
                                                                   <label for="user-name" class="am-u-sm-3 am-form-label">资料上传</label>
                                                                   <div class="am-u-sm-9">
                                                                                   <div id="information" data-height="400px" data-type=true  data-name="poster[information]" data-value="{$info.information}" data-width="600px" data-value="" data-size="4"></div>
                                                                   </div>
                                                   </div>
                                            <script> init_upload1('information' , '请选择文件'); </script>
                                                      <div class="am-form-group">
								<div class="am-u-sm-9 am-u-sm-push-3">
									<button type="submit" class="am-btn am-btn-primary">保存修改</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>

		</div>

        </div>
<script type="text/javascript">
        var goods_type_id = $('#goods_type').val();
        if(goods_type_id){
			$('#goods_type_id option').each(function(){
				if( goods_type_id == $(this).attr('value') ) {
					$(this).attr('selected' , true);
					return false;
				} 
			}); 
			$.get(getUrl('goods/goodsCatAttrList',{ 'category_id':goods_type_id,'goods_id':'{$goods.id}' }) , function( data ){
				if( data.status == 1 ) {
						$('.goods_attr_info').html( data.info );
						$('.goods_attr_list').show();
				} else {
						clearAttr();
				}
			}, 'json');
        }
		$('input#is_invalid_type').click(function(){
			if($(this).val() == 2 ) {
				$('#div_invalid_time').show();
			} else {
				$('#div_invalid_time').hide();
			}
		});
		$('input#stock_status').click(function(){
			if($(this).val() == 2 ) {
				$('#arrive_time').show();
			} else {
				$('#arrive_time').hide();
			}
		});
                
		$('#goods_type_id').change(function(){
			if( $(this).val() != '' ) {
					$.get(getUrl('goods/goodsCatAttrList',{'category_id':$(this).val()}) , function( data ){
						if( data.status == 1 ) {
								$('.goods_attr_info').html( data.info );
								$('.goods_attr_list').show();
						} else {
								clearAttr();
						}
					}, 'json');
			} else {
					clearAttr();
			}
		});
		
		function clearAttr() {
			$('.goods_attr_info').html('');
			$('.goods_attr_list').hide();
		}
 $("#goods_brand_id").comboSelect();
        $("#goods_type_id").comboSelect();
</script>
</block>